//package com.springboot.event;
//
//import com.springboot.SpringbootTestApplicationTests;
//import lombok.extern.slf4j.Slf4j;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.context.ApplicationEventPublisher;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//
///**
// *
// * @author daify
// * @date 2019-08-19
// **/
//@RunWith(SpringJUnit4ClassRunner.class)
//@SpringBootTest(classes = SpringbootTestApplicationTests.class)
//@Slf4j
//public class EventTest {
//
//    @Autowired
//    private ApplicationEventPublisher eventPublisher;
//
//    @Test
//    public void publishTest() {
//        Task task = new Task();
//        task.setId(1L);
//        task.setTaskName("测试任务");
//        task.setTaskContext("任务内容");
//        task.setFinish(false);
//        MyEvent event = new MyEvent(task);
//        log.info("开始发布任务");
//        eventPublisher.publishEvent(event);
//        log.info("发布任务完成");
//    }
//}
//
